package com.jt.controller;

import com.jt.pojo.Log;
import com.jt.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName LogController
 * @Description TODO
 * @Author Jiyao
 * @DATE 2021-11-30 09:19
 * @Version 1.0
 **/
@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    @PostMapping
    public void insertLog(@RequestBody Log log){
        System.out.println("time:"+log.getCreatedTime());
        System.out.println("LogController.doInsertLog->"+Thread.currentThread().getName());
        logService.insertLog(log);
    }
}
